<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>{&SITE_TITLE}</title>
    <script type="text/javascript" src="__PUBLIC__/language/{$lang}/lang.js" ></script>
	<link href="__PUBLIC__/admin/css/layout.css" rel="stylesheet" type="text/css" />
	<link href="__PUBLIC__/js/pagination/pagination.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="__PUBLIC__/js/jquery.js"></script>
	<script type="text/javascript" src="__PUBLIC__/js/jquery.form.js"></script>
	<script type="text/javascript">
		var ctrl = function(name){
			this.elements = document.getElementsByName('id[]');
			this.length = this.elements.length;
		}
		ctrl.prototype = {
			reverse:function(){
				for(i=0;i<this.length;i++){
					this.elements[i].checked= !this.elements[i].checked;
				}
			},
			all:function(){
				for(i=0;i<this.length;i++){
					this.elements[i].checked = true;
				}
			},
			unAll:function(){
				for(i=0;i<this.length;i++){
					this.elements[i].checked = false;
				}
			},
			toggle:function(obj){
				this[obj.checked ? 'all' : 'unAll']();
			},
			del:function(id){
				if(id==undefined){
					id = [];
					for(i=0;i<this.length;i++){
						this.elements[i].checked && id.push(this.elements[i].value);
					}
					id = id.join(',');
				}
				alert('您选择了id为:'+id);
			},
			edit:function(id){
				location.href = "__URL__/edit/id/"+id;
			},
			commend:function(gid,type){
				location.href = "{:U('group/Admin/commend')}&gid="+gid+"&type="+type;
			},
			active:function(gid,type){
				location.href = "{:U('group/Admin/active')}&gid="+gid+"&type="+type;
			},
			reject:function(gid){
				location.href = "{:U('group/Admin/reject')}&gid="+gid;
			}
		}
		var c = null;
	</script>
	</head>
	<body>
		<div id="container">
<div class="tab">
	<ul>
		<volist id="vo" name="menulist">
			<php>$class=($key==MODULE_NAME)?'class="on"':''</php>
			<li><a {$class} href="{$vo}">{$key}</a></li>
		</volist>
	</ul>
</div>
		
    <table class="tableborder" width="100%">
    	<form method="POST" action="{:U('group/Admin/index')}">
          <tbody>
            <tr class="top">
              <td class="border" colspan="2"></td>
            </tr>
            <tr>
              <th class="header" colspan="2">查询</th>
            </tr>
            <tr class="label">
              <th>说明</th>
              <th>条件</th>
            </tr>
            
            <tr class="cell">
              <td class="altbg1">
                <b>团队名称:</b>
                <br/>
                <span class="smalltxt">根据团队名查询</span>
              </td>
              <td class="altbg2"><input name="name" class="txt" value="{$name}"/></td>
            </tr>
		
            <tr class="cell">
              <td class="altbg1">
                <b>团队ID</b>
                <br/>
                <span class="smalltxt">根据团队id</span>
              </td>
              <td class="altbg2"><input name="gid" class="txt" value="{$gid}"/> 多个群组用逗号隔开</td>
            </tr>
                   
                    

		
            <tr class="cell">
              <td class="altbg1">
                <b>团队状态</b>
                <br/>
                <span class="smalltxt">根据用户状态查询。</span>
              </td>
              <td class="altbg2">
              	<select name="status">
              		<option value="9" <eq name="status" value="9">selected</eq> >全部</option>
              		<option value="0" <eq name="status" value="0">selected</eq>>待激活</option>
              		<option value="1" <eq name="status" value="1">selected</eq>>已激活</option>
              	</select>
              </td>
            </tr>
            
            <tr class="cell">
              <td class="altbg1">
                <b>推荐状态</b>
                <br/>
                <span class="smalltxt">根据用户状态查询。</span>
              </td>
              <td class="altbg2">
 				<input type="checkbox" name="commend" value="1" <eq name="commend" value="1">checked</eq> > 已推荐
              </td>
            </tr>            

            <tr class="cell">
              <td class="altbg1">
                <b>结果排序</b>
                <br/>
              </td>
              <td class="altbg2">
                <select name="field">
                  <option value = "cTime" <eq name="field" value="cTime">selected</eq> >注册时间排序</option>
                  <option value = "id" <eq name="field" value="id">selected</eq> >注册id排序</option>
                </select>
                <select name="order">
                  <option value = "DESC" <eq name="order" value="DESC">selected</eq> >降序</option>
                  <option value = "ASC" <eq name="order" value="ASC">selected</eq> >升序</option>
                </select>
                <select name="limit">
                  <option value = "10" <eq name="limit" value="10">selected</eq> >每页显示10条</option>
                  <option value = "20" <eq name="limit" value="20">selected</eq> >每页显示20条</option>
                  <option value = "30" <eq name="limit" value="30">selected</eq> >每页显示30条</option>
                </select>
              </td>
            </tr>            
            <tr>
              <td class="footer" colspan="2">
                <input type="submit" class="submit" value="提交" />
              </td>
            </tr>
          </tbody>
          </form>
        </table>


<table class="tableborder" width="100%">
<form id="userform" action="{:U('group/Admin/doBatch')}" method="POST">
				<tbody>
					<tr class="top">
						<td class="border" colspan="9"></td>
					</tr>
					<tr>
						<th class="header" colspan="9">标题</th>
					</tr>
					<tr>
					
						<td class="footer" colspan="9" style="text-align:left;color:blue;">
						一共有 <font color="red">{$count}</font> 团队
						</td>
					</tr>					
					<tr class="label">
						<th> 选择 <input type="checkbox" onclick="c.toggle(this)" class="checkbox"/></th>
						<th>团队图标</th>
						<th>团队名称</th>
						<th>团队创建者</th>
						<th>团队人数</th>
						<th style="width:200px">申请原因</th>
						<th>创建时间</th>
						<th>状态</th>
						<th>操作</th>
					</tr>
<volist id="vo" name="data">					
					<tr class="cell altbg1">
						<td style="text-align:center;"><input type="checkbox" class="checkbox" name="id[]" value="{$vo.gid}" /></td>
						<td><a href="{:U('group/Core/index',array('gid'=>$vo['gid']))}" target="_blank"><img src="{$vo.icon|getGroupIcon}" style="height:60px;"/></a></td>
						<td><a href="{:U('group/Core/index',array('gid'=>$vo['gid']))}" target="_blank">{$vo.name}</a></td>
						<td><a href="{:U('space/View/index',array('uid'=>$vo['uid']))}" target="_blank">{$vo.uid|getUserName}</a></td>
						<td>{$vo.gid|getCount='member'}</td>
						<td>{$vo.reason}</td>
						<td>{$vo.cTime|date="Y-m-d",###}</td>
						<td><if condition="$vo.status eq '1'"><font color="blue">已认证</font><else /><font color="red">未认证</font></if></td>
						<td>
						<!--	<button type="button" onclick="c.edit({$vo.id})">编辑</button><br><button type="button" onclick="c.del(1)">删除</button>  -->
						
						<if condition="$vo.status eq '1'">
							<button type="button" onclick="c.active({$vo.gid},0)">取消认证</button>
						<else />
							<button type="button" onclick="c.active({$vo.gid},1)" style="color:blue">认证</button>
							<button type="button" onclick="c.reject({$vo.gid})" style="color:blue">拒绝</button>
						</if>
						
						<eq name="vo['status']" value="1">
							<if condition="$vo.commend eq '1'">
								<button type="button" onclick="c.commend({$vo.gid},0)">取消推荐</button>
							<else />
								<button type="button" onclick="c.commend({$vo.gid},1)" style="color:blue">推荐</button>
							</if>
						</eq>
						</td>
					</tr>
</volist>
					<tr class="bottom">
						<td class="border" colspan="6"> </td>
					</tr>
					<tr>
					<td colspan="5"><div style="float:left">全选<input type="checkbox" onclick="c.toggle(this)" class="checkbox"/>&nbsp;&nbsp;&nbsp;操作:<select name="dotype" style="margin-right:10px;" onchange="changeDoType(this);">
						<option value="commend">推荐</option>
						<option value="uncommend">取消推荐</option>
						<option value="active">证证</option>
						<option value="unactive">取消认证</option>
				    </select>
				    <input type="submit" value="提交">
						
					</div>
					
					</td>
						<td class="footer" colspan="4">
						<div class="page mt5 alR mb20" style="float:right;">
							{$html}
						</div>
						</td>
					</tr>
					<tr class="bottom">
						<td class="border" colspan="6">&nbsp;</td>
					</tr>
				</tbody>
				</form>
			</table>        
		</div>
		<script type="text/javascript">

			function changeDoType(o){
				var obj= $("span[name=grouplists]");
				if($(o).val()=='movegroup'){
					obj.show();
				}else{
					obj.hide();
				}
			}
			c = new ctrl('id[]');
		</script>
	</body>
</html>
